//
//  ViewController.m
//  UITouch
//
//  Created by liuchengming on 17/1/21.
//  Copyright © 2017年 liuchengming. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImage * image = [UIImage imageNamed:@"Default"];
    UIImageView * imageView = [[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)];
    imageView.image = image;
    
    [self.view addSubview:imageView];
    
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch * touch = [touches anyObject];
    
    if(touch.tapCount == 1)
    {
        NSLog(@"单击屏幕。");
    }else if (touch.tapCount == 2)
    {
        NSLog(@"双击屏幕。");
    }
    //NSLog(@"手指点击的瞬间调用。");
    
}

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    NSLog(@"手指离开屏幕时调用。");
}

- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    
    NSLog(@"点击屏幕后滑动调用。");
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
